package com.cn.api.controller; /**
 * @author: yihanyuan
 * @Description：
 * @Date: 2018/11/8 15:31
 */

import com.cn.api.service.SendMailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: demo
 * @description:
 * @author: yihanyuan
 * @create: 2018-11-08 15:31
 **/
@RestController
@Api(tags = {"邮箱操作"})
@RequestMapping(value = "mail/")
public class SendMail extends BaseController {
    @Autowired
    SendMailService sendMailService;

    @RequestMapping(value = "send", method = RequestMethod.POST, produces = Res_Type)
    public String sendMail(@ApiParam(name = "emailAddress", value = "emailAddress", required = true) @RequestParam(value = "emailAddress") String emailAddress,
                           @ApiParam(name = "message", value = "message", required = true) @RequestParam(value = "message") String message) {
        sendMailService.send(emailAddress, message);
        return buildSuccessResultInfo("");
    }
}
